import 'package:wan_android/model/user/user_type.dart';

class LoginType {
  final UserType data;
  final int errorCode;
  final String errorMsg;

  LoginType({required this.data, required this.errorCode, required this.errorMsg});

  Map<String, dynamic> toJson() {
    return {
      'data': data.toJson(),
      'errorCode': errorCode,
      'errorMsg': errorMsg
    };
  }

  factory LoginType.fromJson(Map<String, dynamic> json) {
    return LoginType(
      data: UserType.fromJson(json['data']),
      errorCode: json['errorCode'],
      errorMsg: json['errorMsg']
    );
  }
}